<table class="table table-border table-bordered table-hover table-bg">
	<thead>
		<tr class="text-c">
			<th width="25"><input type="checkbox" value="" name=""></th>
			<th>编号</th>
			<th>所在小区</th>
			<th>房间号</th>
			<th>房源</th>
			<th>出租类型</th>
			<th>面积</th>
			<th>押金</th>
			<th>月租</th>
			<th>日租</th>
			<th>物业</th>
			<th>状态</th>
			<th>推荐</th>
			<th>录入员</th>
			<th>录入时间</th>
			<th width="50">操作</th>
		</tr>
	</thead>
	<tbody>
		<?php if(is_array($roomlist) && count($roomlist)){ ?>
		<?php foreach($roomlist as $k=>$user){ ?>
		<tr class="text-c" id="room_{$user['roomid']}">
			<td><input type="checkbox" value="{$user['roomid']}" name=""></td>
			<td><?php echo ($page-1)* C('PAGE_SIZE') + $k + 1; ?></td>
			<td>{$user['villagename']}</td>
			<td>{$user['doornumber']}</td>
			<td>
				<?php if($user['lease_type'] == 1){ ?>
				<input class="btn btn-success size-S radius" type="button" value="自建">
				<?php }else{ ?>
				<input class="btn btn-warning size-S radius" type="button" value="转租">
				<?php } ?>
			</td>
			<td>{$user['rent_type'] == 1 ? '长租' : '短租'}</td>
			<td>{$user['acreage']}</td>
			<td>{$user['deposit']}</td>
			<td>{$user['rent']}</td>
			<td>{$user['dayprice']}</td>
			<td>{$user['property']}</td>
			<td>
				<?php 
					switch($user['status']){
						case 0:
							echo '<input class="btn btn-primary size-S radius" type="button" value="空闲">';
						break;
						case 1:
							echo '<input class="btn btn-secondary size-S radius" type="button" value="入住">';
						break;
						case 2:
							echo '<input class="btn btn-success size-S radius" type="button" value="预约">';
						break;
						case 3:
							echo '<input class="btn btn-warning size-S radius" type="button" value="退房">';
						break;
						case 4:
							echo '<input class="btn btn-danger size-S radius" type="button" value="维护">';
						break;
					}
				?>
			</td>
			<td>{$user['isshow'] == 1 ? '是' : '否'}</td>
			<td>{$user['admin_nick']}</td>
			<td>{$user['createtime']|date="Y-m-d H:i", ###}</td>
			<td>
				<a href="javascript:void(0);" title="编辑" onclick="admin_role_edit('编辑房间信息','roomadd.html?roomid={$user['roomid']}', 1,'920', '600');" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>&nbsp;&nbsp;
				<a href="javascript:void(0);" class="dels" roomid="{$user['roomid']}" title="删除" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
			</td>
		</tr>
		<?php } }else{ ?>
		<tr class="text-c">
			<td colspan="19" >暂无数据...</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<script type="text/javascript">
	$(document).ready(function(){
		$(".dels").on('click', function(){
			var obj = $(this);
			layer.confirm('确定删除该房间吗？', {
				btn: ['确定','取消'] //按钮
			}, function(){
				$.post('room.html',{roomid: obj.attr('roomid')}, function(row){
					if(row/1){
						layer.msg('删除房间成功', {icon: 1, time: 2000}, function(){
							$("#room_"+ obj.attr('roomid')).remove();
						});
					}else{
						layer.msg('删除房间失败',{icon:0, time:2000});
					}
				});
			}, function(){
				
			});
		});
	});
</script>
<!--page-->
<include file="Common/page" />